﻿

using System;
using System.Windows.Printing;
using System.Windows.Browser;
namespace MyFloridaHouse.libSvOpenDistricts.ViewModel
{
    public partial class ViewModelBase
    {
        #region properties
        private bool _isFilePrintActive = false;
        public bool isFilePrintActive
        {
            get { return _isFilePrintActive; }
            set
            {
                if (_isFilePrintActive != value)
                {
                    _isFilePrintActive = value;
                    NotifyPropertyChanged("isFilePrintActive");
                    if (isPrintMapActive == true)
                    {
                        NotifyPropertyChanged("isPrintMapActive");
                    }
                }
            }
        }
        #endregion

        #region Commands

        #region File Print
        private bool CmdFilePrintCanExecute(object parameter)
        {
            return true;
        }

        private void CmdFilePrintExecute(object parameter)
        {
            FilePrint();
        }


        public void FilePrint()
        {
            isFilePrintActive = true;
        }

        public void FilePrintOK()
        {
            HtmlPage.Window.Navigate(new Uri("PrintView.aspx", UriKind.Relative), "_blank");
            isFilePrintActive = false;
        }

        public void FilePrintCancel()
        {
            isFilePrintActive = false;
        }

        #endregion

        #region File Print Cancel
        private bool CmdFilePrintCancelCanExecute(object parameter)
        {
            return true;
        }

        private void CmdFilePrintCancelExecute(object parameter)
        {
            FilePrintCancel();
        }
        #endregion

        #region File Print OK
        private bool CmdFilePrintOKCanExecute(object parameter)
        {
            return true;
        }

        private void CmdFilePrintOKExecute(object parameter)
        {

            //isPrintMapActive = true;
            FilePrintOK();
        }
        #endregion

        #endregion

    }
}

